{% set uniqid = uniqid ?? uniqid('instance_') %}
{% set idBase = "elastic_search-instances-#{uniqid}" %}
{% set nameBase = "elastic_search[instances][#{uniqid}]" %}

<div id="{{ idBase }}" data-uniqid="{{ uniqid }}" data-name="{{ nameBase }}"
     class="tab-pane {{ active is defined and active ? 'active' }}">
    <div class="form-group col-xs-12">
        <label for="{{ idBase }}-name">
            Name
        </label>
        <input type="text" id="{{ idBase }}-name"
               name="{{ nameBase }}[name]"
               placeholder="es-01" class="form-control"
               value="{{ instance.name }}" />
        <div class="help-block">
            At least one instance must be defined
        </div>
    </div>

    <div class="clearfix"></div>

    <div class="form-group col-xs-12">
        <label for="{{ idBase }}-jvm_options">
            JVM Options
        </label>
        <select id="{{ idBase }}-jvm_options"
               name="{{ nameBase }}[jvm_options][]"
               multiple class="form-control select-tags-editable">
            {% for option in instance.jvm_options %}
                <option selected value="{{ option }}">{{ option }}</option>
            {% endfor %}
        </select>
        <div class="help-block">
            <code>Xms</code> and <code>Xmx</code> refer to the memory assigned
            to the instance. Examples are <code>-Xms2G</code>, <code>-Xms512M</code>
        </div>
    </div>

    <div class="clearfix"></div>
</div>
